//
//  BackupsSwitchView.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/1/27.
//

import SwiftUI

//自定义ai图文教程
struct AiCustomTutorialDialog2: View {
    var bean : AiTutorialChildBean
    let onDismiss1: (AiTutorialChildBean?) -> Void
    let onDismiss2: (AiTutorialChildBean?) -> Void

    var body: some View {
        PopupBottomView(title: "教程") {
            VStack(spacing: 15) {
                HStack() {
                    VStack(alignment: .leading) {
                        Text("图文教程")
                            .font(.system(size: 16))
                            .foregroundStyle(.bgNormalText2)
                    }
                    Spacer()
                }.padding(.horizontal,15)
                    .frame(height: 80)
                    .background(.bgItemGray)
                    .cornerRadius(15)
                    .contentShape(Rectangle())
                    .onTapGesture {
                        onDismiss1(bean)
                    }
                HStack() {
                    VStack(alignment: .leading) {
                        Text("进入网页配置")
                            .font(.system(size: 16))
                            .foregroundStyle(.bgNormalText2)
                    }
                    Spacer()
                }.padding(.horizontal,15)
                    .frame(height: 80)
                    .background(.bgItemGray)
                    .cornerRadius(15)
                    .contentShape(Rectangle())
                    .onTapGesture {
                        onDismiss2(bean)
                    }
            }.padding(.top,15)
        }.onAppear{
        }
    }
}

//#Preview {
//    AiCustomTutorialDialog2()
//}
//定义预览提供者
struct AiCustomTutorialDialog2_Previews: PreviewProvider {
    static var previews: some View {
        //使用预览共享配置
        configurePreviewEnvironment(for: AiCustomTutorialDialog2(bean: AiTutorialChildBean(), onDismiss1: {_ in}, onDismiss2: {_ in}))
    }
}
